import type { Request, Response } from 'express';

import { PurePageModel } from '@/models/pure-page';
import Resp from '@/utils/response';
import { z } from 'zod';

export const validator = z.object({
  id: z.string(),
});

export const api = async (req: Request, res: Response): Promise<Response> => {
  const { id } = req.query as z.infer<typeof validator>;
  const list = await PurePageModel.find({ appId: id });
  return Resp.success(res, list, '获取成功');
};
